


import ChartPie from "./ChartPie";
import ChartBar from "./ChartBar";

import type { questionComponentType } from "@/utils/type";



// const data01 = [
//   { name: 'Group A', value: 400 },
//   { name: 'Group B', value: 300 },
//   { name: 'Group C', value: 300 },
//   { name: 'Group D', value: 200 },
//   { name: 'Group E', value: 278 },
//   { name: 'Group F', value: 189 },
// ];

type propsType = {
  component:questionComponentType,
  list:Array<any>,
}

export default function StatChart(props:propsType) {
 
  const { component,list } = props;
  
  if (component?.type === 'questionRadio' || component?.type === 'questionCheckbox')
    if (component?.type === 'questionRadio')
      return (
        <ChartPie list={list} component={component}></ChartPie>
      )
    else
      return <ChartBar list={list} component={component}></ChartBar>

  return (
    <div>无</div>
  )

}
